package com.ocom.payconfig.controller;

import com.ocom.common.constant.PayConfigUrl;
import com.ocom.common.entity.card.EntityXfDeviceInfo;
import com.ocom.common.resp.Result;
import com.ocom.common.utils.ResultUtil;
import com.ocom.payconfig.service.XfDeviceInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description: TODO
 * @Author: 朱晖
 * @Date: 2023/7/13
 **/
@Slf4j
@RestController
public class DeShengDeviceController {

	@Autowired
	private XfDeviceInfoService xfDeviceInfoService;

	@PostMapping(PayConfigUrl.Url_DeShengAddMach)
	public Result addMach(Long comId, String deviceNo)
	{

		EntityXfDeviceInfo entityXfDeviceInfo =  xfDeviceInfoService.GetDeviceInfo(comId,deviceNo);
		if(entityXfDeviceInfo==null){

			EntityXfDeviceInfo entityXfDeviceInfo1 =new EntityXfDeviceInfo();

			xfDeviceInfoService.addConsDeviceInfo(comId,entityXfDeviceInfo1);
		}else{

//			xfDeviceInfoService.updateMenu()

		}


		return ResultUtil.success();
	}

}
